<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="renderer" content="webkit">
	    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<title>角色管理</title>
		<link rel="stylesheet" href="/Public/frame/layui/css/layui.css">
		<!--<link rel="stylesheet" href="http://cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css">-->
		<link rel="stylesheet" href="/Public/frame/static/css/style.css">
	</head>
	<body>
		<button class="layui-btn" style="margin-top: 10px;"  onclick="location.href='<?php echo U('add');?>'"><i class="layui-icon">&#xe654;</i>添加角色</button>
    	<a class="layui-btn btn-add btn-default" id="btn-refresh"style="margin-top: 10px;"><i class="layui-icon">&#x1002;</i></a>
    	<table class="layui-table" border="" cellspacing="" cellpadding="" width="100%">
    		<thead>
    			<tr>
    				<td width="20%">角色名称</td>
    				<td width="60%">权限</td>   				
    				<td width="20%">操作</td>
    			</tr>
    		</thead>
            <tbody>
<?php foreach ($data as $k => $v):?>
            	<tr>
            		<td><?php echo $k;?></td>
            		<td><?php foreach($v as $v1): echo ($v1["pri_name"]); ?> <?php endforeach?></td>
            		<td>            		 
					  <a href="<?php echo U('edit?id='.$v1['id'].'&p='.I('get.p')); ?>" class="layui-btn layui-btn-mini" lay-event="edit">编辑</a>
					  <a href="<?php echo U('delete?id='.$v1['id'].'&p='.I('get.p')); ?>" onclick="return confirm('确定要删除吗？');" class="layui-btn layui-btn-danger layui-btn-mini hahaha" lay-event="del">删除</a>
            		</td>
            	</tr>
<?php endforeach;?> 
            </tbody>
    	</table>
		
		
	</body>
	<script type="text/javascript" src="/Public/hawk/js/jquery-1.8.0.min.js"></script>
	<script>
              // 刷新
        $('#btn-refresh').on('click', function () {
            location.reload();
        });
	
	</script>
</html>